home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / utilit~1 / flut39st.zoo / fileutils-3.9 / configure < prev    next >
Encoding:
Text File  |  1993-10-13  |  55.7 KB  |  2,294 lines

  1. #!/bin/sh
  2. # Guess values for system-dependent variables and create Makefiles.
  3. # Generated automatically using autoconf.
  4. # Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
  5.  
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2, or (at your option)
  9. # any later version.
  10.  
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. # GNU General Public License for more details.
  15.  
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20. # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp]
  21. #        [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE[=VALUE]]
  22. # Ignores all args except --srcdir, --prefix, --exec-prefix, and
  23. # --with-PACKAGE[=VALUE] unless this script has special code to handle it.
  24.  
  25. for arg
  26. do
  27.   # Handle --exec-prefix with a space before the argument.
  28.   if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  29.   # Handle --host with a space before the argument.
  30.   elif test x$next_host = xyes; then next_host=
  31.   # Handle --prefix with a space before the argument.
  32.   elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  33.   # Handle --srcdir with a space before the argument.
  34.   elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  35.   else
  36.     case $arg in
  37.      # For backward compatibility, recognize -exec-prefix and --exec_prefix.
  38.      -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
  39.     exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  40.      -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
  41.     next_exec_prefix=yes ;;
  42.  
  43.      -gas | --gas | --ga | --g) ;;
  44.  
  45.      -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  46.      -host | --host | --hos | --ho | --h)
  47.     next_host=yes ;;
  48.  
  49.      -nfp | --nfp | --nf) ;;
  50.  
  51.      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  52.     prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  53.      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  54.     next_prefix=yes ;;
  55.  
  56.      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  57.     srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  58.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  59.     next_srcdir=yes ;;
  60.  
  61.      -with-* | --with-*)
  62.        package=`echo $arg|sed -e 's/-*with-//' -e 's/=.*//'`
  63.        # Reject names that aren't valid shell variable names.
  64.        if test -n "`echo $package| sed 's/[-a-zA-Z0-9_]//g'`"; then
  65.          echo "configure: $package: invalid package name" >&2; exit 1
  66.        fi
  67.        package=`echo $package| sed 's/-/_/g'`
  68.        case "$arg" in
  69.          *=*) val="`echo $arg|sed 's/[^=]*=//'`" ;;
  70.          *) val=1 ;;
  71.        esac
  72.        eval "with_$package='$val'" ;;
  73.  
  74.      -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
  75.        verbose=yes ;;
  76.  
  77.      *) ;;
  78.     esac
  79.   fi
  80. done
  81.  
  82. trap 'rm -fr conftest* confdefs* core; exit 1' 1 3 15
  83. trap 'rm -f confdefs*' 0
  84.  
  85. # NLS nuisances.
  86. # These must not be set unconditionally because not all systems understand
  87. # e.g. LANG=C (notably SCO).
  88. if test "${LC_ALL+set}" = 'set' ; then LC_ALL=C; export LC_ALL; fi
  89. if test "${LANG+set}"   = 'set' ; then LANG=C;   export LANG;   fi
  90.  
  91. rm -f conftest* confdefs.h
  92. > confdefs.h
  93. compile='${CC-cc} $CFLAGS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  94.  
  95. # A filename unique to this package, relative to the directory that
  96. # configure is in, which we can look for to find out if srcdir is correct.
  97. unique_file=src/ls.c
  98.  
  99. # Find the source files, if location was not specified.
  100. if test -z "$srcdir"; then
  101.   srcdirdefaulted=yes
  102.   # Try the directory containing this script, then `..'.
  103.   prog=$0
  104.   confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  105.   test "X$confdir" = "X$prog" && confdir=.
  106.   srcdir=$confdir
  107.   if test ! -r $srcdir/$unique_file; then
  108.     srcdir=..
  109.   fi
  110. fi
  111. if test ! -r $srcdir/$unique_file; then
  112.   if test x$srcdirdefaulted = xyes; then
  113.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  114.   else
  115.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  116.   fi
  117.   exit 1
  118. fi
  119. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  120. # But we can't avoid them for `..', to make subdirectories work.
  121. case $srcdir in
  122.   .|/*|~*) ;;
  123.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  124. esac
  125.  
  126.  
  127. # Save the original args to write them into config.status later.
  128. configure_args="$*"
  129.  
  130.  
  131.  
  132. # We want these before the checks, so the checks can modify their values.
  133. test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1
  134. test -z "$LDFLAGS" && LDFLAGS=-g
  135.  
  136. if test -z "$CC"; then
  137.   # Extract the first word of `gcc', so it can be a program name with args.
  138.   set dummy gcc; word=$2
  139.   echo checking for $word
  140.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  141.   for dir in $PATH; do
  142.     test -z "$dir" && dir=.
  143.     if test -f $dir/$word; then
  144.       CC="gcc"
  145.       break
  146.     fi
  147.   done
  148.   IFS="$saveifs"
  149. fi
  150. test -z "$CC" && CC="cc"
  151. test -n "$CC" && test -n "$verbose" && echo "    setting CC to $CC"
  152.  
  153. # Find out if we are using GNU C, under whatever name.
  154. cat > conftest.c <<EOF
  155. #ifdef __GNUC__
  156.   yes
  157. #endif
  158. EOF
  159. ${CC-cc} -E conftest.c > conftest.out 2>&1
  160. if egrep yes conftest.out >/dev/null 2>&1; then
  161.   GCC=1 # For later tests.
  162. fi
  163. rm -f conftest*
  164.  
  165.  
  166. # If we're using gcc and the user hasn't specified CFLAGS, add -O to CFLAGS.
  167. test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O"
  168.  
  169.  
  170. echo checking how to run the C preprocessor
  171. if test -z "$CPP"; then
  172.   # This must be in double quotes, not single quotes, because CPP may get
  173.   # substituted into the Makefile and ``${CC-cc}'' will simply confuse
  174.   # make.  It must be expanded now.
  175.   CPP="${CC-cc} -E"
  176.   cat > conftest.c <<EOF
  177. #include "confdefs.h"
  178. #include <stdio.h>
  179. Syntax Error
  180. EOF
  181. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  182. if test -z "$err"; then
  183.   :
  184. else
  185.   rm -rf conftest*
  186.   CPP=/lib/cpp
  187. fi
  188. rm -f conftest*
  189. fi
  190. test ".${verbose}" != "." && echo "    setting CPP to $CPP"
  191.  
  192. if test -n "$GCC"; then
  193.   echo checking whether -traditional is needed
  194.   pattern="Autoconf.*'x'"
  195.   prog='#include <sgtty.h>
  196. Autoconf TIOCGETP'
  197.   cat > conftest.c <<EOF
  198. #include "confdefs.h"
  199. $prog
  200. EOF
  201. eval "$CPP conftest.c > conftest.out 2>&1"
  202. if egrep "$pattern" conftest.out >/dev/null 2>&1; then
  203.   rm -rf conftest*
  204.   need_trad=1
  205.  
  206. fi
  207. rm -f conftest*
  208.  
  209.  
  210.   if test -z "$need_trad"; then
  211.     prog='#include <termio.h>
  212. Autoconf TCGETA'
  213.     cat > conftest.c <<EOF
  214. #include "confdefs.h"
  215. $prog
  216. EOF
  217. eval "$CPP conftest.c > conftest.out 2>&1"
  218. if egrep "$pattern" conftest.out >/dev/null 2>&1; then
  219.   rm -rf conftest*
  220.   need_trad=1
  221.  
  222. fi
  223. rm -f conftest*
  224.  
  225.   fi
  226.   test -n "$need_trad" && CC="$CC -traditional"
  227. fi
  228.  
  229. if test -z "$RANLIB"; then
  230.   # Extract the first word of `ranlib', so it can be a program name with args.
  231.   set dummy ranlib; word=$2
  232.   echo checking for $word
  233.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  234.   for dir in $PATH; do
  235.     test -z "$dir" && dir=.
  236.     if test -f $dir/$word; then
  237.       RANLIB="ranlib"
  238.       break
  239.     fi
  240.   done
  241.   IFS="$saveifs"
  242. fi
  243. test -z "$RANLIB" && RANLIB=":"
  244. test -n "$RANLIB" && test -n "$verbose" && echo "    setting RANLIB to $RANLIB"
  245.  
  246. for p in 'bison -y' byacc
  247. do
  248. if test -z "$YACC"; then
  249.   # Extract the first word of `$p', so it can be a program name with args.
  250.   set dummy $p; word=$2
  251.   echo checking for $word
  252.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  253.   for dir in $PATH; do
  254.     test -z "$dir" && dir=.
  255.     if test -f $dir/$word; then
  256.       YACC="$p"
  257.       break
  258.     fi
  259.   done
  260.   IFS="$saveifs"
  261. fi
  262.  
  263. test -n "$YACC" && test -n "$verbose" && echo "    setting YACC to $YACC"
  264.  
  265. test -n "$YACC" && break
  266. done
  267. test -n "$YACC" || YACC="yacc"
  268.  
  269. echo checking for AIX
  270. cat > conftest.c <<EOF
  271. #include "confdefs.h"
  272. #ifdef _AIX
  273.   yes
  274. #endif
  275.  
  276. EOF
  277. eval "$CPP conftest.c > conftest.out 2>&1"
  278. if egrep "yes" conftest.out >/dev/null 2>&1; then
  279.   rm -rf conftest*
  280.   
  281. {
  282. test -n "$verbose" && \
  283. echo "    defining _ALL_SOURCE"
  284. echo "#define" _ALL_SOURCE 1 >> confdefs.h
  285. DEFS="$DEFS -D_ALL_SOURCE=1"
  286. SEDDEFS="${SEDDEFS}\${SEDdA}_ALL_SOURCE\${SEDdB}_ALL_SOURCE\${SEDdC}1\${SEDdD}
  287. \${SEDuA}_ALL_SOURCE\${SEDuB}_ALL_SOURCE\${SEDuC}1\${SEDuD}
  288. \${SEDeA}_ALL_SOURCE\${SEDeB}_ALL_SOURCE\${SEDeC}1\${SEDeD}
  289. "
  290. }
  291.  
  292.  
  293. fi
  294. rm -f conftest*
  295.  
  296.  
  297. echo checking for minix/config.h
  298. cat > conftest.c <<EOF
  299. #include "confdefs.h"
  300. #include <minix/config.h>
  301. EOF
  302. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  303. if test -z "$err"; then
  304.   rm -rf conftest*
  305.   MINIX=1
  306.  
  307. fi
  308. rm -f conftest*
  309.  
  310. # The Minix shell can't assign to the same variable on the same line!
  311. if test -n "$MINIX"; then
  312.   
  313. {
  314. test -n "$verbose" && \
  315. echo "    defining _POSIX_SOURCE"
  316. echo "#define" _POSIX_SOURCE 1 >> confdefs.h
  317. DEFS="$DEFS -D_POSIX_SOURCE=1"
  318. SEDDEFS="${SEDDEFS}\${SEDdA}_POSIX_SOURCE\${SEDdB}_POSIX_SOURCE\${SEDdC}1\${SEDdD}
  319. \${SEDuA}_POSIX_SOURCE\${SEDuB}_POSIX_SOURCE\${SEDuC}1\${SEDuD}
  320. \${SEDeA}_POSIX_SOURCE\${SEDeB}_POSIX_SOURCE\${SEDeC}1\${SEDeD}
  321. "
  322. }
  323.  
  324.   
  325. {
  326. test -n "$verbose" && \
  327. echo "    defining" _POSIX_1_SOURCE to be 2
  328. echo "#define" _POSIX_1_SOURCE 2 >> confdefs.h
  329. DEFS="$DEFS -D_POSIX_1_SOURCE=2"
  330. SEDDEFS="${SEDDEFS}\${SEDdA}_POSIX_1_SOURCE\${SEDdB}_POSIX_1_SOURCE\${SEDdC}2\${SEDdD}
  331. \${SEDuA}_POSIX_1_SOURCE\${SEDuB}_POSIX_1_SOURCE\${SEDuC}2\${SEDuD}
  332. \${SEDeA}_POSIX_1_SOURCE\${SEDeB}_POSIX_1_SOURCE\${SEDeC}2\${SEDeD}
  333. "
  334. }
  335.  
  336.   
  337. {
  338. test -n "$verbose" && \
  339. echo "    defining _MINIX"
  340. echo "#define" _MINIX 1 >> confdefs.h
  341. DEFS="$DEFS -D_MINIX=1"
  342. SEDDEFS="${SEDDEFS}\${SEDdA}_MINIX\${SEDdB}_MINIX\${SEDdC}1\${SEDdD}
  343. \${SEDuA}_MINIX\${SEDuB}_MINIX\${SEDuC}1\${SEDuD}
  344. \${SEDeA}_MINIX\${SEDeB}_MINIX\${SEDeC}1\${SEDeD}
  345. "
  346. }
  347.  
  348. fi
  349.  
  350. echo checking for POSIXized ISC
  351. if test -d /etc/conf/kconfig.d &&
  352.   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
  353. then
  354.   ISC=1 # If later tests want to check for ISC.
  355.   
  356. {
  357. test -n "$verbose" && \
  358. echo "    defining _POSIX_SOURCE"
  359. echo "#define" _POSIX_SOURCE 1 >> confdefs.h
  360. DEFS="$DEFS -D_POSIX_SOURCE=1"
  361. SEDDEFS="${SEDDEFS}\${SEDdA}_POSIX_SOURCE\${SEDdB}_POSIX_SOURCE\${SEDdC}1\${SEDdD}
  362. \${SEDuA}_POSIX_SOURCE\${SEDuB}_POSIX_SOURCE\${SEDuC}1\${SEDuD}
  363. \${SEDeA}_POSIX_SOURCE\${SEDeB}_POSIX_SOURCE\${SEDeC}1\${SEDeD}
  364. "
  365. }
  366.  
  367.   if test -n "$GCC"; then
  368.     CC="$CC -posix"
  369.   else
  370.     CC="$CC -Xp"
  371.   fi
  372. fi
  373.  
  374. echo checking for major, minor and makedev header
  375. cat > conftest.c <<EOF
  376. #include "confdefs.h"
  377. #include <sys/types.h>
  378. int main() { exit(0); }
  379. int t() { return makedev(0, 0); }
  380. EOF
  381. if eval $compile; then
  382.   rm -rf conftest*
  383.   makedev=1
  384.  
  385. fi
  386. rm -f conftest*
  387.  
  388. if test -z "$makedev"; then
  389. echo checking for sys/mkdev.h
  390. cat > conftest.c <<EOF
  391. #include "confdefs.h"
  392. #include <sys/mkdev.h>
  393. EOF
  394. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  395. if test -z "$err"; then
  396.   rm -rf conftest*
  397.   
  398. {
  399. test -n "$verbose" && \
  400. echo "    defining MAJOR_IN_MKDEV"
  401. echo "#define" MAJOR_IN_MKDEV 1 >> confdefs.h
  402. DEFS="$DEFS -DMAJOR_IN_MKDEV=1"
  403. SEDDEFS="${SEDDEFS}\${SEDdA}MAJOR_IN_MKDEV\${SEDdB}MAJOR_IN_MKDEV\${SEDdC}1\${SEDdD}
  404. \${SEDuA}MAJOR_IN_MKDEV\${SEDuB}MAJOR_IN_MKDEV\${SEDuC}1\${SEDuD}
  405. \${SEDeA}MAJOR_IN_MKDEV\${SEDeB}MAJOR_IN_MKDEV\${SEDeC}1\${SEDeD}
  406. "
  407. }
  408.  makedev=1
  409.  
  410. fi
  411. rm -f conftest*
  412.  
  413. fi
  414. if test -z "$makedev"; then
  415. echo checking for sys/sysmacros.h
  416. cat > conftest.c <<EOF
  417. #include "confdefs.h"
  418. #include <sys/sysmacros.h>
  419. EOF
  420. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  421. if test -z "$err"; then
  422.   rm -rf conftest*
  423.   
  424. {
  425. test -n "$verbose" && \
  426. echo "    defining MAJOR_IN_SYSMACROS"
  427. echo "#define" MAJOR_IN_SYSMACROS 1 >> confdefs.h
  428. DEFS="$DEFS -DMAJOR_IN_SYSMACROS=1"
  429. SEDDEFS="${SEDDEFS}\${SEDdA}MAJOR_IN_SYSMACROS\${SEDdB}MAJOR_IN_SYSMACROS\${SEDdC}1\${SEDdD}
  430. \${SEDuA}MAJOR_IN_SYSMACROS\${SEDuB}MAJOR_IN_SYSMACROS\${SEDuC}1\${SEDuD}
  431. \${SEDeA}MAJOR_IN_SYSMACROS\${SEDeB}MAJOR_IN_SYSMACROS\${SEDeC}1\${SEDeD}
  432. "
  433. }
  434.  
  435.  
  436. fi
  437. rm -f conftest*
  438.  
  439. fi
  440.  
  441. echo checking for directory library header
  442. dirheader=
  443. if test -z "$dirheader"; then
  444.   echo checking for dirent.h
  445. cat > conftest.c <<EOF
  446. #include "confdefs.h"
  447. #include <sys/types.h>
  448. #include <dirent.h>
  449. int main() { exit(0); }
  450. int t() { DIR *dirp = 0; }
  451. EOF
  452. if eval $compile; then
  453.   rm -rf conftest*
  454.   
  455. {
  456. test -n "$verbose" && \
  457. echo "    defining DIRENT"
  458. echo "#define" DIRENT 1 >> confdefs.h
  459. DEFS="$DEFS -DDIRENT=1"
  460. SEDDEFS="${SEDDEFS}\${SEDdA}DIRENT\${SEDdB}DIRENT\${SEDdC}1\${SEDdD}
  461. \${SEDuA}DIRENT\${SEDuB}DIRENT\${SEDuC}1\${SEDuD}
  462. \${SEDeA}DIRENT\${SEDeB}DIRENT\${SEDeC}1\${SEDeD}
  463. "
  464. }
  465.  dirheader=dirent.h
  466.  
  467. fi
  468. rm -f conftest*
  469. fi
  470. if test -z "$dirheader"; then
  471.   echo checking for sys/ndir.h
  472. cat > conftest.c <<EOF
  473. #include "confdefs.h"
  474. #include <sys/types.h>
  475. #include <sys/ndir.h>
  476. int main() { exit(0); }
  477. int t() { DIR *dirp = 0; }
  478. EOF
  479. if eval $compile; then
  480.   rm -rf conftest*
  481.   
  482. {
  483. test -n "$verbose" && \
  484. echo "    defining SYSNDIR"
  485. echo "#define" SYSNDIR 1 >> confdefs.h
  486. DEFS="$DEFS -DSYSNDIR=1"
  487. SEDDEFS="${SEDDEFS}\${SEDdA}SYSNDIR\${SEDdB}SYSNDIR\${SEDdC}1\${SEDdD}
  488. \${SEDuA}SYSNDIR\${SEDuB}SYSNDIR\${SEDuC}1\${SEDuD}
  489. \${SEDeA}SYSNDIR\${SEDeB}SYSNDIR\${SEDeC}1\${SEDeD}
  490. "
  491. }
  492.  dirheader=sys/ndir.h
  493.  
  494. fi
  495. rm -f conftest*
  496. fi
  497. if test -z "$dirheader"; then
  498.   echo checking for sys/dir.h
  499. cat > conftest.c <<EOF
  500. #include "confdefs.h"
  501. #include <sys/types.h>
  502. #include <sys/dir.h>
  503. int main() { exit(0); }
  504. int t() { DIR *dirp = 0; }
  505. EOF
  506. if eval $compile; then
  507.   rm -rf conftest*
  508.   
  509. {
  510. test -n "$verbose" && \
  511. echo "    defining SYSDIR"
  512. echo "#define" SYSDIR 1 >> confdefs.h
  513. DEFS="$DEFS -DSYSDIR=1"
  514. SEDDEFS="${SEDDEFS}\${SEDdA}SYSDIR\${SEDdB}SYSDIR\${SEDdC}1\${SEDdD}
  515. \${SEDuA}SYSDIR\${SEDuB}SYSDIR\${SEDuC}1\${SEDuD}
  516. \${SEDeA}SYSDIR\${SEDeB}SYSDIR\${SEDeC}1\${SEDeD}
  517. "
  518. }
  519.  dirheader=sys/dir.h
  520.  
  521. fi
  522. rm -f conftest*
  523. fi
  524. if test -z "$dirheader"; then
  525.   echo checking for ndir.h
  526. cat > conftest.c <<EOF
  527. #include "confdefs.h"
  528. #include <sys/types.h>
  529. #include <ndir.h>
  530. int main() { exit(0); }
  531. int t() { DIR *dirp = 0; }
  532. EOF
  533. if eval $compile; then
  534.   rm -rf conftest*
  535.   
  536. {
  537. test -n "$verbose" && \
  538. echo "    defining NDIR"
  539. echo "#define" NDIR 1 >> confdefs.h
  540. DEFS="$DEFS -DNDIR=1"
  541. SEDDEFS="${SEDDEFS}\${SEDdA}NDIR\${SEDdB}NDIR\${SEDdC}1\${SEDdD}
  542. \${SEDuA}NDIR\${SEDuB}NDIR\${SEDuC}1\${SEDuD}
  543. \${SEDeA}NDIR\${SEDeB}NDIR\${SEDeC}1\${SEDeD}
  544. "
  545. }
  546.  dirheader=ndir.h
  547.  
  548. fi
  549. rm -f conftest*
  550. fi
  551.  
  552. echo checking for closedir return value
  553. cat > conftest.c <<EOF
  554. #include "confdefs.h"
  555. #include <sys/types.h>
  556. #include <$dirheader>
  557. int closedir(); main() { exit(closedir(opendir(".")) != 0); }
  558. EOF
  559. eval $compile
  560. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  561.   :
  562. else
  563.   rm -rf conftest*
  564.   
  565. {
  566. test -n "$verbose" && \
  567. echo "    defining VOID_CLOSEDIR"
  568. echo "#define" VOID_CLOSEDIR 1 >> confdefs.h
  569. DEFS="$DEFS -DVOID_CLOSEDIR=1"
  570. SEDDEFS="${SEDDEFS}\${SEDdA}VOID_CLOSEDIR\${SEDdB}VOID_CLOSEDIR\${SEDdC}1\${SEDdD}
  571. \${SEDuA}VOID_CLOSEDIR\${SEDuB}VOID_CLOSEDIR\${SEDuC}1\${SEDuD}
  572. \${SEDeA}VOID_CLOSEDIR\${SEDeB}VOID_CLOSEDIR\${SEDeC}1\${SEDeD}
  573. "
  574. }
  575.  
  576. fi
  577. rm -f conftest*
  578.  
  579. echo checking for return type of signal handlers
  580. cat > conftest.c <<EOF
  581. #include "confdefs.h"
  582. #include <sys/types.h>
  583. #include <signal.h>
  584. #ifdef signal
  585. #undef signal
  586. #endif
  587. extern void (*signal ()) ();
  588. int main() { exit(0); }
  589. int t() { int i; }
  590. EOF
  591. if eval $compile; then
  592.   rm -rf conftest*
  593.   
  594. {
  595. test -n "$verbose" && \
  596. echo "    defining" RETSIGTYPE to be void
  597. echo "#define" RETSIGTYPE void >> confdefs.h
  598. DEFS="$DEFS -DRETSIGTYPE=void"
  599. SEDDEFS="${SEDDEFS}\${SEDdA}RETSIGTYPE\${SEDdB}RETSIGTYPE\${SEDdC}void\${SEDdD}
  600. \${SEDuA}RETSIGTYPE\${SEDuB}RETSIGTYPE\${SEDuC}void\${SEDuD}
  601. \${SEDeA}RETSIGTYPE\${SEDeB}RETSIGTYPE\${SEDeC}void\${SEDeD}
  602. "
  603. }
  604.  
  605.  
  606. else
  607.   rm -rf conftest*
  608.   
  609. {
  610. test -n "$verbose" && \
  611. echo "    defining" RETSIGTYPE to be int
  612. echo "#define" RETSIGTYPE int >> confdefs.h
  613. DEFS="$DEFS -DRETSIGTYPE=int"
  614. SEDDEFS="${SEDDEFS}\${SEDdA}RETSIGTYPE\${SEDdB}RETSIGTYPE\${SEDdC}int\${SEDdD}
  615. \${SEDuA}RETSIGTYPE\${SEDuB}RETSIGTYPE\${SEDuC}int\${SEDuD}
  616. \${SEDeA}RETSIGTYPE\${SEDeB}RETSIGTYPE\${SEDeC}int\${SEDeD}
  617. "
  618. }
  619.  
  620. fi
  621. rm -f conftest*
  622.  
  623.  
  624.  
  625. echo checking how to get list of mounted filesystems
  626. mounted=
  627.  
  628. # DEC Alpha running OSF/1.
  629. cat > conftest.c <<EOF
  630. #include "confdefs.h"
  631.  
  632. #include <sys/types.h>
  633. #include <sys/mount.h>
  634. #include <sys/fs_types.h>
  635. int main() { exit(0); }
  636. int t() { struct statfs *stats;
  637. numsys = getfsstat ((struct statfs *)0, 0L, MNT_WAIT);  }
  638. EOF
  639. if eval $compile; then
  640.   rm -rf conftest*
  641.   
  642. {
  643. test -n "$verbose" && \
  644. echo "    defining MOUNTED_GETFSSTAT"
  645. echo "#define" MOUNTED_GETFSSTAT 1 >> confdefs.h
  646. DEFS="$DEFS -DMOUNTED_GETFSSTAT=1"
  647. SEDDEFS="${SEDDEFS}\${SEDdA}MOUNTED_GETFSSTAT\${SEDdB}MOUNTED_GETFSSTAT\${SEDdC}1\${SEDdD}
  648. \${SEDuA}MOUNTED_GETFSSTAT\${SEDuB}MOUNTED_GETFSSTAT\${SEDuC}1\${SEDuD}
  649. \${SEDeA}MOUNTED_GETFSSTAT\${SEDeB}MOUNTED_GETFSSTAT\${SEDeC}1\${SEDeD}
  650. "
  651. }
  652.  mounted=1
  653.  
  654. fi
  655. rm -f conftest*
  656.  
  657. if test -z "$mounted"; then
  658. # SVR4
  659. echo '#include "confdefs.h"
  660. #include <sys/mnttab.h>' > conftest.c
  661. eval "$CPP conftest.c > conftest.out 2>&1"
  662. if egrep "getmntent" conftest.out >/dev/null 2>&1; then
  663.   rm -rf conftest*
  664.   
  665. {
  666. test -n "$verbose" && \
  667. echo "    defining MOUNTED_GETMNTENT2"
  668. echo "#define" MOUNTED_GETMNTENT2 1 >> confdefs.h
  669. DEFS="$DEFS -DMOUNTED_GETMNTENT2=1"
  670. SEDDEFS="${SEDDEFS}\${SEDdA}MOUNTED_GETMNTENT2\${SEDdB}MOUNTED_GETMNTENT2\${SEDdC}1\${SEDdD}
  671. \${SEDuA}MOUNTED_GETMNTENT2\${SEDuB}MOUNTED_GETMNTENT2\${SEDuC}1\${SEDuD}
  672. \${SEDeA}MOUNTED_GETMNTENT2\${SEDeB}MOUNTED_GETMNTENT2\${SEDeC}1\${SEDeD}
  673. "
  674. }
  675.  mounted=1
  676.  
  677. fi
  678. rm -f conftest*
  679.  
  680. fi
  681. if test -z "$mounted"; then
  682. # AIX.
  683. cat > conftest.c <<EOF
  684. #include "confdefs.h"
  685. #include <fshelp.h>
  686. EOF
  687. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  688. if test -z "$err"; then
  689.   rm -rf conftest*
  690.   
  691. {
  692. test -n "$verbose" && \
  693. echo "    defining MOUNTED_VMOUNT"
  694. echo "#define" MOUNTED_VMOUNT 1 >> confdefs.h
  695. DEFS="$DEFS -DMOUNTED_VMOUNT=1"
  696. SEDDEFS="${SEDDEFS}\${SEDdA}MOUNTED_VMOUNT\${SEDdB}MOUNTED_VMOUNT\${SEDdC}1\${SEDdD}
  697. \${SEDuA}MOUNTED_VMOUNT\${SEDuB}MOUNTED_VMOUNT\${SEDuC}1\${SEDuD}
  698. \${SEDeA}MOUNTED_VMOUNT\${SEDeB}MOUNTED_VMOUNT\${SEDeC}1\${SEDeD}
  699. "
  700. }
  701.  mounted=1
  702.  
  703. fi
  704. rm -f conftest*
  705. fi
  706. if test -z "$mounted"; then
  707. # SVR3
  708. cat > conftest.c <<EOF
  709. #include "confdefs.h"
  710. #include <sys/statfs.h>
  711. #include <sys/fstyp.h>
  712. #include <mnttab.h>
  713. EOF
  714. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  715. if test -z "$err"; then
  716.   rm -rf conftest*
  717.   
  718. {
  719. test -n "$verbose" && \
  720. echo "    defining MOUNTED_FREAD_FSTYP"
  721. echo "#define" MOUNTED_FREAD_FSTYP 1 >> confdefs.h
  722. DEFS="$DEFS -DMOUNTED_FREAD_FSTYP=1"
  723. SEDDEFS="${SEDDEFS}\${SEDdA}MOUNTED_FREAD_FSTYP\${SEDdB}MOUNTED_FREAD_FSTYP\${SEDdC}1\${SEDdD}
  724. \${SEDuA}MOUNTED_FREAD_FSTYP\${SEDuB}MOUNTED_FREAD_FSTYP\${SEDuC}1\${SEDuD}
  725. \${SEDeA}MOUNTED_FREAD_FSTYP\${SEDeB}MOUNTED_FREAD_FSTYP\${SEDeC}1\${SEDeD}
  726. "
  727. }
  728.  mounted=1
  729.  
  730. fi
  731. rm -f conftest*
  732. fi
  733. if test -z "$mounted"; then
  734. # 4.3BSD
  735. cat > conftest.c <<EOF
  736. #include "confdefs.h"
  737. #include <mntent.h>
  738. EOF
  739. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  740. if test -z "$err"; then
  741.   rm -rf conftest*
  742.   
  743. {
  744. test -n "$verbose" && \
  745. echo "    defining MOUNTED_GETMNTENT1"
  746. echo "#define" MOUNTED_GETMNTENT1 1 >> confdefs.h
  747. DEFS="$DEFS -DMOUNTED_GETMNTENT1=1"
  748. SEDDEFS="${SEDDEFS}\${SEDdA}MOUNTED_GETMNTENT1\${SEDdB}MOUNTED_GETMNTENT1\${SEDdC}1\${SEDdD}
  749. \${SEDuA}MOUNTED_GETMNTENT1\${SEDuB}MOUNTED_GETMNTENT1\${SEDuC}1\${SEDuD}
  750. \${SEDeA}MOUNTED_GETMNTENT1\${SEDeB}MOUNTED_GETMNTENT1\${SEDeC}1\${SEDeD}
  751. "
  752. }
  753.  mounted=1
  754.  
  755. fi
  756. rm -f conftest*
  757. fi
  758. if test -z "$mounted"; then
  759. # 4.4BSD and DEC OSF/1.
  760. echo '#include "confdefs.h"
  761. #include <sys/mount.h>' > conftest.c
  762. eval "$CPP conftest.c > conftest.out 2>&1"
  763. if egrep "f_type;" conftest.out >/dev/null 2>&1; then
  764.   rm -rf conftest*
  765.   
  766. {
  767. test -n "$verbose" && \
  768. echo "    defining MOUNTED_GETMNTINFO"
  769. echo "#define" MOUNTED_GETMNTINFO 1 >> confdefs.h
  770. DEFS="$DEFS -DMOUNTED_GETMNTINFO=1"
  771. SEDDEFS="${SEDDEFS}\${SEDdA}MOUNTED_GETMNTINFO\${SEDdB}MOUNTED_GETMNTINFO\${SEDdC}1\${SEDdD}
  772. \${SEDuA}MOUNTED_GETMNTINFO\${SEDuB}MOUNTED_GETMNTINFO\${SEDuC}1\${SEDuD}
  773. \${SEDeA}MOUNTED_GETMNTINFO\${SEDeB}MOUNTED_GETMNTINFO\${SEDeC}1\${SEDeD}
  774. "
  775. }
  776.  mounted=1
  777.  
  778. fi
  779. rm -f conftest*
  780.  
  781. fi
  782. if test -z "$mounted"; then
  783. # Ultrix
  784. cat > conftest.c <<EOF
  785. #include "confdefs.h"
  786. #include <sys/fs_types.h>
  787. #include <sys/mount.h>
  788. EOF
  789. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  790. if test -z "$err"; then
  791.   rm -rf conftest*
  792.   
  793. {
  794. test -n "$verbose" && \
  795. echo "    defining MOUNTED_GETMNT"
  796. echo "#define" MOUNTED_GETMNT 1 >> confdefs.h
  797. DEFS="$DEFS -DMOUNTED_GETMNT=1"
  798. SEDDEFS="${SEDDEFS}\${SEDdA}MOUNTED_GETMNT\${SEDdB}MOUNTED_GETMNT\${SEDdC}1\${SEDdD}
  799. \${SEDuA}MOUNTED_GETMNT\${SEDuB}MOUNTED_GETMNT\${SEDuC}1\${SEDuD}
  800. \${SEDeA}MOUNTED_GETMNT\${SEDeB}MOUNTED_GETMNT\${SEDeC}1\${SEDeD}
  801. "
  802. }
  803.  mounted=1
  804.  
  805. fi
  806. rm -f conftest*
  807. fi
  808. if test -z "$mounted"; then
  809. # SVR2
  810. cat > conftest.c <<EOF
  811. #include "confdefs.h"
  812. #include <mnttab.h>
  813. EOF
  814. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  815. if test -z "$err"; then
  816.   rm -rf conftest*
  817.   
  818. {
  819. test -n "$verbose" && \
  820. echo "    defining MOUNTED_FREAD"
  821. echo "#define" MOUNTED_FREAD 1 >> confdefs.h
  822. DEFS="$DEFS -DMOUNTED_FREAD=1"
  823. SEDDEFS="${SEDDEFS}\${SEDdA}MOUNTED_FREAD\${SEDdB}MOUNTED_FREAD\${SEDdC}1\${SEDdD}
  824. \${SEDuA}MOUNTED_FREAD\${SEDuB}MOUNTED_FREAD\${SEDuC}1\${SEDuD}
  825. \${SEDeA}MOUNTED_FREAD\${SEDeB}MOUNTED_FREAD\${SEDeC}1\${SEDeD}
  826. "
  827. }
  828.  mounted=1
  829.  
  830. fi
  831. rm -f conftest*
  832. fi
  833.  
  834. echo checking how to get filesystem space usage
  835. space=
  836.  
  837. # DEC Alpha running OSF/1
  838. cat > conftest.c <<EOF
  839. #include "confdefs.h"
  840.  
  841. #include <sys/types.h>
  842. #include <sys/mount.h>
  843. main ()
  844. {
  845. struct statfs fsd;
  846. fsd.f_fsize = 0;
  847. exit (statfs (".", &fsd, sizeof (struct statfs)));
  848. }
  849. EOF
  850. eval $compile
  851. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  852.   rm -rf conftest*
  853.   
  854. {
  855. test -n "$verbose" && \
  856. echo "    defining STAT_STATFS3_OSF1"
  857. echo "#define" STAT_STATFS3_OSF1 1 >> confdefs.h
  858. DEFS="$DEFS -DSTAT_STATFS3_OSF1=1"
  859. SEDDEFS="${SEDDEFS}\${SEDdA}STAT_STATFS3_OSF1\${SEDdB}STAT_STATFS3_OSF1\${SEDdC}1\${SEDdD}
  860. \${SEDuA}STAT_STATFS3_OSF1\${SEDuB}STAT_STATFS3_OSF1\${SEDuC}1\${SEDuD}
  861. \${SEDeA}STAT_STATFS3_OSF1\${SEDeB}STAT_STATFS3_OSF1\${SEDeC}1\${SEDeD}
  862. "
  863. }
  864.  space=1
  865.  
  866. fi
  867. rm -f conftest*
  868. if test -z "$space"; then
  869. # SVR4
  870. cat > conftest.c <<EOF
  871. #include "confdefs.h"
  872. #include <sys/statvfs.h>
  873. #include <sys/fstyp.h>
  874. EOF
  875. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  876. if test -z "$err"; then
  877.   rm -rf conftest*
  878.   
  879. {
  880. test -n "$verbose" && \
  881. echo "    defining STAT_STATVFS"
  882. echo "#define" STAT_STATVFS 1 >> confdefs.h
  883. DEFS="$DEFS -DSTAT_STATVFS=1"
  884. SEDDEFS="${SEDDEFS}\${SEDdA}STAT_STATVFS\${SEDdB}STAT_STATVFS\${SEDdC}1\${SEDdD}
  885. \${SEDuA}STAT_STATVFS\${SEDuB}STAT_STATVFS\${SEDuC}1\${SEDuD}
  886. \${SEDeA}STAT_STATVFS\${SEDeB}STAT_STATVFS\${SEDeC}1\${SEDeD}
  887. "
  888. }
  889.  space=1
  890.  
  891. fi
  892. rm -f conftest*
  893. fi
  894. if test -z "$space"; then
  895. # AIX
  896. echo '#include "confdefs.h"
  897. #include <sys/statfs.h>' > conftest.c
  898. eval "$CPP conftest.c > conftest.out 2>&1"
  899. if egrep "f_nlsdirtype" conftest.out >/dev/null 2>&1; then
  900.   rm -rf conftest*
  901.   
  902. {
  903. test -n "$verbose" && \
  904. echo "    defining STAT_STATFS2_BSIZE"
  905. echo "#define" STAT_STATFS2_BSIZE 1 >> confdefs.h
  906. DEFS="$DEFS -DSTAT_STATFS2_BSIZE=1"
  907. SEDDEFS="${SEDDEFS}\${SEDdA}STAT_STATFS2_BSIZE\${SEDdB}STAT_STATFS2_BSIZE\${SEDdC}1\${SEDdD}
  908. \${SEDuA}STAT_STATFS2_BSIZE\${SEDuB}STAT_STATFS2_BSIZE\${SEDuC}1\${SEDuD}
  909. \${SEDeA}STAT_STATFS2_BSIZE\${SEDeB}STAT_STATFS2_BSIZE\${SEDeC}1\${SEDeD}
  910. "
  911. }
  912.  space=1
  913.  
  914. fi
  915. rm -f conftest*
  916.  
  917. fi
  918. if test -z "$space"; then
  919. # SVR3
  920. cat > conftest.c <<EOF
  921. #include "confdefs.h"
  922. #include <sys/statfs.h>
  923. EOF
  924. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  925. if test -z "$err"; then
  926.   rm -rf conftest*
  927.   
  928. {
  929. test -n "$verbose" && \
  930. echo "    defining STAT_STATFS4"
  931. echo "#define" STAT_STATFS4 1 >> confdefs.h
  932. DEFS="$DEFS -DSTAT_STATFS4=1"
  933. SEDDEFS="${SEDDEFS}\${SEDdA}STAT_STATFS4\${SEDdB}STAT_STATFS4\${SEDdC}1\${SEDdD}
  934. \${SEDuA}STAT_STATFS4\${SEDuB}STAT_STATFS4\${SEDuC}1\${SEDuD}
  935. \${SEDeA}STAT_STATFS4\${SEDeB}STAT_STATFS4\${SEDeC}1\${SEDeD}
  936. "
  937. }
  938.  space=1
  939.  
  940. fi
  941. rm -f conftest*
  942. fi
  943. if test -z "$space"; then
  944. # 4.3BSD
  945. cat > conftest.c <<EOF
  946. #include "confdefs.h"
  947. #include <sys/vfs.h>
  948. EOF
  949. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  950. if test -z "$err"; then
  951.   rm -rf conftest*
  952.   
  953. {
  954. test -n "$verbose" && \
  955. echo "    defining STAT_STATFS2_BSIZE"
  956. echo "#define" STAT_STATFS2_BSIZE 1 >> confdefs.h
  957. DEFS="$DEFS -DSTAT_STATFS2_BSIZE=1"
  958. SEDDEFS="${SEDDEFS}\${SEDdA}STAT_STATFS2_BSIZE\${SEDdB}STAT_STATFS2_BSIZE\${SEDdC}1\${SEDdD}
  959. \${SEDuA}STAT_STATFS2_BSIZE\${SEDuB}STAT_STATFS2_BSIZE\${SEDuC}1\${SEDuD}
  960. \${SEDeA}STAT_STATFS2_BSIZE\${SEDeB}STAT_STATFS2_BSIZE\${SEDeC}1\${SEDeD}
  961. "
  962. }
  963.  space=1
  964.  
  965. fi
  966. rm -f conftest*
  967. fi
  968. if test -z "$space"; then
  969. # 4.4BSD
  970. echo '#include "confdefs.h"
  971. #include <sys/mount.h>' > conftest.c
  972. eval "$CPP conftest.c > conftest.out 2>&1"
  973. if egrep "MOUNT_UFS" conftest.out >/dev/null 2>&1; then
  974.   rm -rf conftest*
  975.   
  976. {
  977. test -n "$verbose" && \
  978. echo "    defining STAT_STATFS2_FSIZE"
  979. echo "#define" STAT_STATFS2_FSIZE 1 >> confdefs.h
  980. DEFS="$DEFS -DSTAT_STATFS2_FSIZE=1"
  981. SEDDEFS="${SEDDEFS}\${SEDdA}STAT_STATFS2_FSIZE\${SEDdB}STAT_STATFS2_FSIZE\${SEDdC}1\${SEDdD}
  982. \${SEDuA}STAT_STATFS2_FSIZE\${SEDuB}STAT_STATFS2_FSIZE\${SEDuC}1\${SEDuD}
  983. \${SEDeA}STAT_STATFS2_FSIZE\${SEDeB}STAT_STATFS2_FSIZE\${SEDeC}1\${SEDeD}
  984. "
  985. }
  986.  space=1
  987.  
  988. fi
  989. rm -f conftest*
  990.  
  991. fi
  992. if test -z "$space"; then
  993. # SVR2
  994. cat > conftest.c <<EOF
  995. #include "confdefs.h"
  996. #include <sys/filsys.h>
  997. EOF
  998. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  999. if test -z "$err"; then
  1000.   rm -rf conftest*
  1001.   
  1002. {
  1003. test -n "$verbose" && \
  1004. echo "    defining STAT_READ"
  1005. echo "#define" STAT_READ 1 >> confdefs.h
  1006. DEFS="$DEFS -DSTAT_READ=1"
  1007. SEDDEFS="${SEDDEFS}\${SEDdA}STAT_READ\${SEDdB}STAT_READ\${SEDdC}1\${SEDdD}
  1008. \${SEDuA}STAT_READ\${SEDuB}STAT_READ\${SEDuC}1\${SEDuD}
  1009. \${SEDeA}STAT_READ\${SEDeB}STAT_READ\${SEDeC}1\${SEDeD}
  1010. "
  1011. }
  1012.  space=1
  1013.  
  1014. fi
  1015. rm -f conftest*
  1016. fi
  1017. if test -z "$space"; then
  1018. # Ultrix
  1019. cat > conftest.c <<EOF
  1020. #include "confdefs.h"
  1021. #include <sys/mount.h>
  1022. EOF
  1023. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  1024. if test -z "$err"; then
  1025.   rm -rf conftest*
  1026.   
  1027. {
  1028. test -n "$verbose" && \
  1029. echo "    defining STAT_STATFS2_FS_DATA"
  1030. echo "#define" STAT_STATFS2_FS_DATA 1 >> confdefs.h
  1031. DEFS="$DEFS -DSTAT_STATFS2_FS_DATA=1"
  1032. SEDDEFS="${SEDDEFS}\${SEDdA}STAT_STATFS2_FS_DATA\${SEDdB}STAT_STATFS2_FS_DATA\${SEDdC}1\${SEDdD}
  1033. \${SEDuA}STAT_STATFS2_FS_DATA\${SEDuB}STAT_STATFS2_FS_DATA\${SEDuC}1\${SEDuD}
  1034. \${SEDeA}STAT_STATFS2_FS_DATA\${SEDeB}STAT_STATFS2_FS_DATA\${SEDeC}1\${SEDeD}
  1035. "
  1036. }
  1037.  space=1
  1038.  
  1039. fi
  1040. rm -f conftest*
  1041. fi
  1042. if test -n "$mounted" && test -n "$space"; then
  1043.   PROGS="$PROGS df" LIBOBJS="$LIBOBJS fsusage.o mountlist.o"
  1044. fi
  1045.  
  1046. echo checking for uid_t in sys/types.h
  1047. echo '#include "confdefs.h"
  1048. #include <sys/types.h>' > conftest.c
  1049. eval "$CPP conftest.c > conftest.out 2>&1"
  1050. if egrep "uid_t" conftest.out >/dev/null 2>&1; then
  1051.   :
  1052. else
  1053.   rm -rf conftest*
  1054.   
  1055. {
  1056. test -n "$verbose" && \
  1057. echo "    defining" uid_t to be int
  1058. echo "#define" uid_t int >> confdefs.h
  1059. DEFS="$DEFS -Duid_t=int"
  1060. SEDDEFS="${SEDDEFS}\${SEDdA}uid_t\${SEDdB}uid_t\${SEDdC}int\${SEDdD}
  1061. \${SEDuA}uid_t\${SEDuB}uid_t\${SEDuC}int\${SEDuD}
  1062. \${SEDeA}uid_t\${SEDeB}uid_t\${SEDeC}int\${SEDeD}
  1063. "
  1064. }
  1065.  
  1066. {
  1067. test -n "$verbose" && \
  1068. echo "    defining" gid_t to be int
  1069. echo "#define" gid_t int >> confdefs.h
  1070. DEFS="$DEFS -Dgid_t=int"
  1071. SEDDEFS="${SEDDEFS}\${SEDdA}gid_t\${SEDdB}gid_t\${SEDdC}int\${SEDdD}
  1072. \${SEDuA}gid_t\${SEDuB}gid_t\${SEDuC}int\${SEDuD}
  1073. \${SEDeA}gid_t\${SEDeB}gid_t\${SEDeC}int\${SEDeD}
  1074. "
  1075. }
  1076.  
  1077. fi
  1078. rm -f conftest*
  1079.  
  1080. echo checking for type of array argument to getgroups
  1081. prog='/* Thanks to Mike Rendell for this test.  */
  1082. #include <sys/types.h>
  1083. #define NGID 256
  1084. #undef MAX
  1085. #define MAX(x,y) ((x) > (y) ? (x) : (y))
  1086. main()
  1087. {
  1088.   gid_t gidset[NGID];
  1089.   int i, n;
  1090.   union { gid_t gval; long lval; }  val;
  1091.  
  1092.   val.lval = -1;
  1093.   for (i = 0; i < NGID; i++)
  1094.     gidset[i] = val.gval;
  1095.   n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
  1096.                  gidset);
  1097.   /* Exit non-zero if getgroups seems to require an array of ints.  This
  1098.      happens when gid_t is short but getgroups modifies an array of ints.  */
  1099.   exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
  1100. }'
  1101. cat > conftest.c <<EOF
  1102. #include "confdefs.h"
  1103. $prog
  1104. EOF
  1105. eval $compile
  1106. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1107.   rm -rf conftest*
  1108.   
  1109. {
  1110. test -n "$verbose" && \
  1111. echo "    defining" GETGROUPS_T to be gid_t
  1112. echo "#define" GETGROUPS_T gid_t >> confdefs.h
  1113. DEFS="$DEFS -DGETGROUPS_T=gid_t"
  1114. SEDDEFS="${SEDDEFS}\${SEDdA}GETGROUPS_T\${SEDdB}GETGROUPS_T\${SEDdC}gid_t\${SEDdD}
  1115. \${SEDuA}GETGROUPS_T\${SEDuB}GETGROUPS_T\${SEDuC}gid_t\${SEDuD}
  1116. \${SEDeA}GETGROUPS_T\${SEDeB}GETGROUPS_T\${SEDeC}gid_t\${SEDeD}
  1117. "
  1118. }
  1119.  
  1120.  
  1121. else
  1122.   rm -rf conftest*
  1123.   
  1124. {
  1125. test -n "$verbose" && \
  1126. echo "    defining" GETGROUPS_T to be int
  1127. echo "#define" GETGROUPS_T int >> confdefs.h
  1128. DEFS="$DEFS -DGETGROUPS_T=int"
  1129. SEDDEFS="${SEDDEFS}\${SEDdA}GETGROUPS_T\${SEDdB}GETGROUPS_T\${SEDdC}int\${SEDdD}
  1130. \${SEDuA}GETGROUPS_T\${SEDuB}GETGROUPS_T\${SEDuC}int\${SEDuD}
  1131. \${SEDeA}GETGROUPS_T\${SEDeB}GETGROUPS_T\${SEDeC}int\${SEDeD}
  1132. "
  1133. }
  1134.  
  1135. fi
  1136. rm -f conftest*
  1137.  
  1138. echo checking integer size
  1139. cat > conftest.c <<EOF
  1140. #include "confdefs.h"
  1141. main() { exit(sizeof(int) != 2); }
  1142. EOF
  1143. eval $compile
  1144. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1145.   rm -rf conftest*
  1146.   
  1147. {
  1148. test -n "$verbose" && \
  1149. echo "    defining INT_16_BITS"
  1150. echo "#define" INT_16_BITS 1 >> confdefs.h
  1151. DEFS="$DEFS -DINT_16_BITS=1"
  1152. SEDDEFS="${SEDDEFS}\${SEDdA}INT_16_BITS\${SEDdB}INT_16_BITS\${SEDdC}1\${SEDdD}
  1153. \${SEDuA}INT_16_BITS\${SEDuB}INT_16_BITS\${SEDuC}1\${SEDuD}
  1154. \${SEDeA}INT_16_BITS\${SEDeB}INT_16_BITS\${SEDeC}1\${SEDeD}
  1155. "
  1156. }
  1157.  
  1158.  
  1159. fi
  1160. rm -f conftest*
  1161.  
  1162. prog='/* Ultrix mips cc rejects this.  */
  1163. typedef int charset[2]; const charset x;
  1164. /* SunOS 4.1.1 cc rejects this.  */
  1165. char const *const *ccp;
  1166. char **p;
  1167. /* AIX XL C 1.02.0.0 rejects this.
  1168.    It does not let you subtract one const X* pointer from another in an arm
  1169.    of an if-expression whose if-part is not a constant expression */
  1170. const char *g = "string";
  1171. ccp = &g + (g ? g-g : 0);
  1172. /* HPUX 7.0 cc rejects these. */
  1173. ++ccp;
  1174. p = (char**) ccp;
  1175. ccp = (char const *const *) p;
  1176. { /* SCO 3.2v4 cc rejects this.  */
  1177.   char *t;
  1178.   char const *s = 0 ? (char *) 0 : (char const *) 0;
  1179.  
  1180.   *t++ = 0;
  1181. }
  1182. { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
  1183.   int x[] = {25,17};
  1184.   const int *foo = &x[0];
  1185.   ++foo;
  1186. }
  1187. { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
  1188.   typedef const int *iptr;
  1189.   iptr p = 0;
  1190.   ++p;
  1191. }
  1192. { /* AIX XL C 1.02.0.0 rejects this saying
  1193.      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
  1194.   struct s { int j; const int *ap[3]; };
  1195.   struct s *b; b->j = 5;
  1196. }'
  1197. echo checking for lack of working const
  1198. cat > conftest.c <<EOF
  1199. #include "confdefs.h"
  1200.  
  1201. int main() { exit(0); }
  1202. int t() { $prog }
  1203. EOF
  1204. if eval $compile; then
  1205.   :
  1206. else
  1207.   rm -rf conftest*
  1208.   
  1209. {
  1210. test -n "$verbose" && \
  1211. echo "    defining" const to be empty
  1212. echo "#define" const  >> confdefs.h
  1213. DEFS="$DEFS -Dconst="
  1214. SEDDEFS="${SEDDEFS}\${SEDdA}const\${SEDdB}const\${SEDdC}\${SEDdD}
  1215. \${SEDuA}const\${SEDuB}const\${SEDuC}\${SEDuD}
  1216. \${SEDeA}const\${SEDeB}const\${SEDeC}\${SEDeD}
  1217. "
  1218. }
  1219.  
  1220. fi
  1221. rm -f conftest*
  1222.  
  1223. echo checking for ANSI C header files
  1224. cat > conftest.c <<EOF
  1225. #include "confdefs.h"
  1226. #include <stdlib.h>
  1227. #include <stdarg.h>
  1228. #include <string.h>
  1229. #include <float.h>
  1230. EOF
  1231. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  1232. if test -z "$err"; then
  1233.   rm -rf conftest*
  1234.   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
  1235. echo '#include "confdefs.h"
  1236. #include <string.h>' > conftest.c
  1237. eval "$CPP conftest.c > conftest.out 2>&1"
  1238. if egrep "memchr" conftest.out >/dev/null 2>&1; then
  1239.   rm -rf conftest*
  1240.   # SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
  1241. cat > conftest.c <<EOF
  1242. #include "confdefs.h"
  1243. #include <ctype.h>
  1244. #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
  1245. #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
  1246. #define XOR(e,f) (((e) && !(f)) || (!(e) && (f)))
  1247. int main () { int i; for (i = 0; i < 256; i++)
  1248. if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
  1249. exit (0); }
  1250.  
  1251. EOF
  1252. eval $compile
  1253. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1254.   rm -rf conftest*
  1255.   
  1256. {
  1257. test -n "$verbose" && \
  1258. echo "    defining STDC_HEADERS"
  1259. echo "#define" STDC_HEADERS 1 >> confdefs.h
  1260. DEFS="$DEFS -DSTDC_HEADERS=1"
  1261. SEDDEFS="${SEDDEFS}\${SEDdA}STDC_HEADERS\${SEDdB}STDC_HEADERS\${SEDdC}1\${SEDdD}
  1262. \${SEDuA}STDC_HEADERS\${SEDuB}STDC_HEADERS\${SEDuC}1\${SEDuD}
  1263. \${SEDeA}STDC_HEADERS\${SEDeB}STDC_HEADERS\${SEDeC}1\${SEDeD}
  1264. "
  1265. }
  1266.  
  1267.  
  1268. fi
  1269. rm -f conftest*
  1270.  
  1271. fi
  1272. rm -f conftest*
  1273.  
  1274.  
  1275. fi
  1276. rm -f conftest*
  1277.  
  1278. echo checking for struct tm in time.h
  1279. cat > conftest.c <<EOF
  1280. #include "confdefs.h"
  1281. #include <sys/types.h>
  1282. #include <time.h>
  1283. int main() { exit(0); }
  1284. int t() { struct tm *tp; tp->tm_sec; }
  1285. EOF
  1286. if eval $compile; then
  1287.   :
  1288. else
  1289.   rm -rf conftest*
  1290.   
  1291. {
  1292. test -n "$verbose" && \
  1293. echo "    defining TM_IN_SYS_TIME"
  1294. echo "#define" TM_IN_SYS_TIME 1 >> confdefs.h
  1295. DEFS="$DEFS -DTM_IN_SYS_TIME=1"
  1296. SEDDEFS="${SEDDEFS}\${SEDdA}TM_IN_SYS_TIME\${SEDdB}TM_IN_SYS_TIME\${SEDdC}1\${SEDdD}
  1297. \${SEDuA}TM_IN_SYS_TIME\${SEDuB}TM_IN_SYS_TIME\${SEDuC}1\${SEDuD}
  1298. \${SEDeA}TM_IN_SYS_TIME\${SEDeB}TM_IN_SYS_TIME\${SEDeC}1\${SEDeD}
  1299. "
  1300. }
  1301.  
  1302. fi
  1303. rm -f conftest*
  1304.  
  1305. echo checking for whether time.h and sys/time.h may both be included
  1306. cat > conftest.c <<EOF
  1307. #include "confdefs.h"
  1308. #include <sys/types.h>
  1309. #include <sys/time.h>
  1310. #include <time.h>
  1311. int main() { exit(0); }
  1312. int t() { struct tm *tp; }
  1313. EOF
  1314. if eval $compile; then
  1315.   rm -rf conftest*
  1316.   
  1317. {
  1318. test -n "$verbose" && \
  1319. echo "    defining TIME_WITH_SYS_TIME"
  1320. echo "#define" TIME_WITH_SYS_TIME 1 >> confdefs.h
  1321. DEFS="$DEFS -DTIME_WITH_SYS_TIME=1"
  1322. SEDDEFS="${SEDDEFS}\${SEDdA}TIME_WITH_SYS_TIME\${SEDdB}TIME_WITH_SYS_TIME\${SEDdC}1\${SEDdD}
  1323. \${SEDuA}TIME_WITH_SYS_TIME\${SEDuB}TIME_WITH_SYS_TIME\${SEDuC}1\${SEDuD}
  1324. \${SEDeA}TIME_WITH_SYS_TIME\${SEDeB}TIME_WITH_SYS_TIME\${SEDeC}1\${SEDeD}
  1325. "
  1326. }
  1327.  
  1328.  
  1329. fi
  1330. rm -f conftest*
  1331.  
  1332. echo checking for broken stat file mode macros
  1333. cat > conftest.c <<EOF
  1334. #include "confdefs.h"
  1335. #include <sys/types.h>
  1336. #include <sys/stat.h>
  1337. #ifdef S_ISBLK
  1338. #if S_ISBLK (S_IFDIR)
  1339. You lose.
  1340. #endif
  1341. #ifdef S_IFCHR
  1342. #if S_ISBLK (S_IFCHR)
  1343. You lose.
  1344. #endif
  1345. #endif /* S_IFCHR */
  1346. #endif /* S_ISBLK */
  1347. #ifdef S_ISLNK
  1348. #if S_ISLNK (S_IFREG)
  1349. You lose.
  1350. #endif
  1351. #endif /* S_ISLNK */
  1352. #ifdef S_ISSOCK
  1353. #if S_ISSOCK (S_IFREG)
  1354. You lose.
  1355. #endif
  1356. #endif /* S_ISSOCK */
  1357.  
  1358. EOF
  1359. eval "$CPP conftest.c > conftest.out 2>&1"
  1360. if egrep "You lose" conftest.out >/dev/null 2>&1; then
  1361.   rm -rf conftest*
  1362.   
  1363. {
  1364. test -n "$verbose" && \
  1365. echo "    defining STAT_MACROS_BROKEN"
  1366. echo "#define" STAT_MACROS_BROKEN 1 >> confdefs.h
  1367. DEFS="$DEFS -DSTAT_MACROS_BROKEN=1"
  1368. SEDDEFS="${SEDDEFS}\${SEDdA}STAT_MACROS_BROKEN\${SEDdB}STAT_MACROS_BROKEN\${SEDdC}1\${SEDdD}
  1369. \${SEDuA}STAT_MACROS_BROKEN\${SEDuB}STAT_MACROS_BROKEN\${SEDuC}1\${SEDuD}
  1370. \${SEDeA}STAT_MACROS_BROKEN\${SEDeB}STAT_MACROS_BROKEN\${SEDeC}1\${SEDeD}
  1371. "
  1372. }
  1373.  
  1374.  
  1375. fi
  1376. rm -f conftest*
  1377.  
  1378. for hdr in string.h fcntl.h limits.h sys/time.h errno.h unistd.h
  1379. do
  1380. trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
  1381. echo checking for ${hdr}
  1382. cat > conftest.c <<EOF
  1383. #include "confdefs.h"
  1384. #include <${hdr}>
  1385. EOF
  1386. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  1387. if test -z "$err"; then
  1388.   rm -rf conftest*
  1389.   
  1390. {
  1391. test -n "$verbose" && \
  1392. echo "    defining ${trhdr}"
  1393. echo "#define" ${trhdr} 1 >> confdefs.h
  1394. DEFS="$DEFS -D${trhdr}=1"
  1395. SEDDEFS="${SEDDEFS}\${SEDdA}${trhdr}\${SEDdB}${trhdr}\${SEDdC}1\${SEDdD}
  1396. \${SEDuA}${trhdr}\${SEDuB}${trhdr}\${SEDuC}1\${SEDuD}
  1397. \${SEDeA}${trhdr}\${SEDeB}${trhdr}\${SEDeC}1\${SEDeD}
  1398. "
  1399. }
  1400.  
  1401.  
  1402. fi
  1403. rm -f conftest*
  1404. done
  1405.  
  1406. for func in fnmatch mkdir mktime stpcpy strdup strstr rename
  1407. do
  1408. echo checking for ${func}
  1409. cat > conftest.c <<EOF
  1410. #include "confdefs.h"
  1411. #include <ctype.h>
  1412. int main() { exit(0); }
  1413. int t() { 
  1414. /* The GNU C library defines this for functions which it implements
  1415.     to always fail with ENOSYS.  Some functions are actually named
  1416.     something starting with __ and the normal name is an alias.  */
  1417. #if defined (__stub_${func}) || defined (__stub___${func})
  1418. choke me
  1419. #else
  1420. /* Override any gcc2 internal prototype to avoid an error.  */
  1421. extern char ${func}(); ${func}();
  1422. #endif
  1423.  }
  1424. EOF
  1425. if eval $compile; then
  1426.   :
  1427. else
  1428.   rm -rf conftest*
  1429.   LIBOBJS="$LIBOBJS ${func}.o"
  1430. test -n "$verbose" && echo "    using ${func}.o instead"
  1431. fi
  1432. rm -f conftest*
  1433.  
  1434. done
  1435.  
  1436. for func in strerror ftime getcwd mkfifo memcpy bcopy gettimeofday
  1437. do
  1438. trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  1439. echo checking for ${func}
  1440. cat > conftest.c <<EOF
  1441. #include "confdefs.h"
  1442. #include <ctype.h>
  1443. int main() { exit(0); }
  1444. int t() { 
  1445. /* The GNU C library defines this for functions which it implements
  1446.     to always fail with ENOSYS.  Some functions are actually named
  1447.     something starting with __ and the normal name is an alias.  */
  1448. #if defined (__stub_${func}) || defined (__stub___${func})
  1449. choke me
  1450. #else
  1451. /* Override any gcc2 internal prototype to avoid an error.  */
  1452. extern char ${func}(); ${func}();
  1453. #endif
  1454.  }
  1455. EOF
  1456. if eval $compile; then
  1457.   rm -rf conftest*
  1458.   {
  1459. test -n "$verbose" && \
  1460. echo "    defining ${trfunc}"
  1461. echo "#define" ${trfunc} 1 >> confdefs.h
  1462. DEFS="$DEFS -D${trfunc}=1"
  1463. SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
  1464. \${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
  1465. \${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
  1466. "
  1467. }
  1468.  
  1469.  
  1470. fi
  1471. rm -f conftest*
  1472. done
  1473.  
  1474. echo checking for ftruncate
  1475. cat > conftest.c <<EOF
  1476. #include "confdefs.h"
  1477.  
  1478. int main() { exit(0); }
  1479. int t() { ftruncate(); }
  1480. EOF
  1481. if eval $compile; then
  1482.   rm -rf conftest*
  1483.   
  1484. {
  1485. test -n "$verbose" && \
  1486. echo "    defining HAVE_FTRUNCATE"
  1487. echo "#define" HAVE_FTRUNCATE 1 >> confdefs.h
  1488. DEFS="$DEFS -DHAVE_FTRUNCATE=1"
  1489. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_FTRUNCATE\${SEDdB}HAVE_FTRUNCATE\${SEDdC}1\${SEDdD}
  1490. \${SEDuA}HAVE_FTRUNCATE\${SEDuB}HAVE_FTRUNCATE\${SEDuC}1\${SEDuD}
  1491. \${SEDeA}HAVE_FTRUNCATE\${SEDeB}HAVE_FTRUNCATE\${SEDeC}1\${SEDeD}
  1492. "
  1493. }
  1494.  
  1495.  
  1496. else
  1497.   rm -rf conftest*
  1498.   ftruncate_missing=1
  1499. fi
  1500. rm -f conftest*
  1501.  
  1502. if test -n "$ftruncate_missing"; then
  1503. echo checking for fcntl emulation of ftruncate
  1504. cat > conftest.c <<EOF
  1505. #include "confdefs.h"
  1506. #include <sys/types.h>
  1507. #include <fcntl.h>
  1508. int main() { exit(0); }
  1509. int t() { 
  1510. #if !defined(F_CHSIZE) && !defined(F_FREESP)
  1511. chsize();
  1512. #endif
  1513.  }
  1514. EOF
  1515. if eval $compile; then
  1516.   rm -rf conftest*
  1517.   
  1518. {
  1519. test -n "$verbose" && \
  1520. echo "    defining HAVE_FTRUNCATE"
  1521. echo "#define" HAVE_FTRUNCATE 1 >> confdefs.h
  1522. DEFS="$DEFS -DHAVE_FTRUNCATE=1"
  1523. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_FTRUNCATE\${SEDdB}HAVE_FTRUNCATE\${SEDdC}1\${SEDdD}
  1524. \${SEDuA}HAVE_FTRUNCATE\${SEDuB}HAVE_FTRUNCATE\${SEDuC}1\${SEDuD}
  1525. \${SEDeA}HAVE_FTRUNCATE\${SEDeB}HAVE_FTRUNCATE\${SEDeC}1\${SEDeD}
  1526. "
  1527. }
  1528.  LIBOBJS="$LIBOBJS ftruncate.o"
  1529.  
  1530. fi
  1531. rm -f conftest*
  1532.  
  1533. fi
  1534.  
  1535. case "$LIBOBJS" in
  1536. *rename.o*)
  1537.   LIBPROGS="$LIBPROGS mvdir"
  1538.   ;;
  1539. esac
  1540.  
  1541. echo checking for vprintf
  1542. cat > conftest.c <<EOF
  1543. #include "confdefs.h"
  1544.  
  1545. int main() { exit(0); }
  1546. int t() { vprintf(); }
  1547. EOF
  1548. if eval $compile; then
  1549.   rm -rf conftest*
  1550.   
  1551. {
  1552. test -n "$verbose" && \
  1553. echo "    defining HAVE_VPRINTF"
  1554. echo "#define" HAVE_VPRINTF 1 >> confdefs.h
  1555. DEFS="$DEFS -DHAVE_VPRINTF=1"
  1556. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_VPRINTF\${SEDdB}HAVE_VPRINTF\${SEDdC}1\${SEDdD}
  1557. \${SEDuA}HAVE_VPRINTF\${SEDuB}HAVE_VPRINTF\${SEDuC}1\${SEDuD}
  1558. \${SEDeA}HAVE_VPRINTF\${SEDeB}HAVE_VPRINTF\${SEDeC}1\${SEDeD}
  1559. "
  1560. }
  1561.  
  1562.  
  1563. else
  1564.   rm -rf conftest*
  1565.   vprintf_missing=1
  1566. fi
  1567. rm -f conftest*
  1568.  
  1569. if test -n "$vprintf_missing"; then
  1570. echo checking for _doprnt
  1571. cat > conftest.c <<EOF
  1572. #include "confdefs.h"
  1573.  
  1574. int main() { exit(0); }
  1575. int t() { _doprnt(); }
  1576. EOF
  1577. if eval $compile; then
  1578.   rm -rf conftest*
  1579.   
  1580. {
  1581. test -n "$verbose" && \
  1582. echo "    defining HAVE_DOPRNT"
  1583. echo "#define" HAVE_DOPRNT 1 >> confdefs.h
  1584. DEFS="$DEFS -DHAVE_DOPRNT=1"
  1585. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_DOPRNT\${SEDdB}HAVE_DOPRNT\${SEDdC}1\${SEDdD}
  1586. \${SEDuA}HAVE_DOPRNT\${SEDuB}HAVE_DOPRNT\${SEDuC}1\${SEDuD}
  1587. \${SEDeA}HAVE_DOPRNT\${SEDeB}HAVE_DOPRNT\${SEDeC}1\${SEDeD}
  1588. "
  1589. }
  1590.  
  1591.  
  1592. fi
  1593. rm -f conftest*
  1594.  
  1595. fi
  1596.  
  1597. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
  1598. # for constant arguments.  Useless!
  1599. echo checking for working alloca.h
  1600. cat > conftest.c <<EOF
  1601. #include "confdefs.h"
  1602. #include <alloca.h>
  1603. int main() { exit(0); }
  1604. int t() { char *p = alloca(2 * sizeof(int)); }
  1605. EOF
  1606. if eval $compile; then
  1607.   rm -rf conftest*
  1608.   
  1609. {
  1610. test -n "$verbose" && \
  1611. echo "    defining HAVE_ALLOCA_H"
  1612. echo "#define" HAVE_ALLOCA_H 1 >> confdefs.h
  1613. DEFS="$DEFS -DHAVE_ALLOCA_H=1"
  1614. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_ALLOCA_H\${SEDdB}HAVE_ALLOCA_H\${SEDdC}1\${SEDdD}
  1615. \${SEDuA}HAVE_ALLOCA_H\${SEDuB}HAVE_ALLOCA_H\${SEDuC}1\${SEDuD}
  1616. \${SEDeA}HAVE_ALLOCA_H\${SEDeB}HAVE_ALLOCA_H\${SEDeC}1\${SEDeD}
  1617. "
  1618. }
  1619.  
  1620.  
  1621. fi
  1622. rm -f conftest*
  1623.  
  1624. decl="#ifdef __GNUC__
  1625. #define alloca __builtin_alloca
  1626. #else
  1627. #if HAVE_ALLOCA_H
  1628. #include <alloca.h>
  1629. #else
  1630. #ifdef _AIX
  1631.  #pragma alloca
  1632. #else
  1633. char *alloca ();
  1634. #endif
  1635. #endif
  1636. #endif
  1637. "
  1638. echo checking for alloca
  1639. cat > conftest.c <<EOF
  1640. #include "confdefs.h"
  1641. $decl
  1642. int main() { exit(0); }
  1643. int t() { char *p = (char *) alloca(1); }
  1644. EOF
  1645. if eval $compile; then
  1646.   :
  1647. else
  1648.   rm -rf conftest*
  1649.   alloca_missing=1
  1650. cat > conftest.c <<EOF
  1651. #include "confdefs.h"
  1652.  
  1653. #if defined(CRAY) && ! defined(CRAY2)
  1654. winnitude
  1655. #else
  1656. lossage
  1657. #endif
  1658.  
  1659. EOF
  1660. eval "$CPP conftest.c > conftest.out 2>&1"
  1661. if egrep "winnitude" conftest.out >/dev/null 2>&1; then
  1662.   rm -rf conftest*
  1663.   echo checking for _getb67
  1664. cat > conftest.c <<EOF
  1665. #include "confdefs.h"
  1666. #include <ctype.h>
  1667. int main() { exit(0); }
  1668. int t() { 
  1669. /* The GNU C library defines this for functions which it implements
  1670.     to always fail with ENOSYS.  Some functions are actually named
  1671.     something starting with __ and the normal name is an alias.  */
  1672. #if defined (__stub__getb67) || defined (__stub____getb67)
  1673. choke me
  1674. #else
  1675. /* Override any gcc2 internal prototype to avoid an error.  */
  1676. extern char _getb67(); _getb67();
  1677. #endif
  1678.  }
  1679. EOF
  1680. if eval $compile; then
  1681.   rm -rf conftest*
  1682.   {
  1683. test -n "$verbose" && \
  1684. echo "    defining" CRAY_STACKSEG_END to be _getb67
  1685. echo "#define" CRAY_STACKSEG_END _getb67 >> confdefs.h
  1686. DEFS="$DEFS -DCRAY_STACKSEG_END=_getb67"
  1687. SEDDEFS="${SEDDEFS}\${SEDdA}CRAY_STACKSEG_END\${SEDdB}CRAY_STACKSEG_END\${SEDdC}_getb67\${SEDdD}
  1688. \${SEDuA}CRAY_STACKSEG_END\${SEDuB}CRAY_STACKSEG_END\${SEDuC}_getb67\${SEDuD}
  1689. \${SEDeA}CRAY_STACKSEG_END\${SEDeB}CRAY_STACKSEG_END\${SEDeC}_getb67\${SEDeD}
  1690. "
  1691. }
  1692.  
  1693.  
  1694. else
  1695.   rm -rf conftest*
  1696.   echo checking for GETB67
  1697. cat > conftest.c <<EOF
  1698. #include "confdefs.h"
  1699. #include <ctype.h>
  1700. int main() { exit(0); }
  1701. int t() { 
  1702. /* The GNU C library defines this for functions which it implements
  1703.     to always fail with ENOSYS.  Some functions are actually named
  1704.     something starting with __ and the normal name is an alias.  */
  1705. #if defined (__stub_GETB67) || defined (__stub___GETB67)
  1706. choke me
  1707. #else
  1708. /* Override any gcc2 internal prototype to avoid an error.  */
  1709. extern char GETB67(); GETB67();
  1710. #endif
  1711.  }
  1712. EOF
  1713. if eval $compile; then
  1714.   rm -rf conftest*
  1715.   {
  1716. test -n "$verbose" && \
  1717. echo "    defining" CRAY_STACKSEG_END to be GETB67
  1718. echo "#define" CRAY_STACKSEG_END GETB67 >> confdefs.h
  1719. DEFS="$DEFS -DCRAY_STACKSEG_END=GETB67"
  1720. SEDDEFS="${SEDDEFS}\${SEDdA}CRAY_STACKSEG_END\${SEDdB}CRAY_STACKSEG_END\${SEDdC}GETB67\${SEDdD}
  1721. \${SEDuA}CRAY_STACKSEG_END\${SEDuB}CRAY_STACKSEG_END\${SEDuC}GETB67\${SEDuD}
  1722. \${SEDeA}CRAY_STACKSEG_END\${SEDeB}CRAY_STACKSEG_END\${SEDeC}GETB67\${SEDeD}
  1723. "
  1724. }
  1725.  
  1726.  
  1727. else
  1728.   rm -rf conftest*
  1729.   echo checking for getb67
  1730. cat > conftest.c <<EOF
  1731. #include "confdefs.h"
  1732. #include <ctype.h>
  1733. int main() { exit(0); }
  1734. int t() { 
  1735. /* The GNU C library defines this for functions which it implements
  1736.     to always fail with ENOSYS.  Some functions are actually named
  1737.     something starting with __ and the normal name is an alias.  */
  1738. #if defined (__stub_getb67) || defined (__stub___getb67)
  1739. choke me
  1740. #else
  1741. /* Override any gcc2 internal prototype to avoid an error.  */
  1742. extern char getb67(); getb67();
  1743. #endif
  1744.  }
  1745. EOF
  1746. if eval $compile; then
  1747.   rm -rf conftest*
  1748.   {
  1749. test -n "$verbose" && \
  1750. echo "    defining" CRAY_STACKSEG_END to be getb67
  1751. echo "#define" CRAY_STACKSEG_END getb67 >> confdefs.h
  1752. DEFS="$DEFS -DCRAY_STACKSEG_END=getb67"
  1753. SEDDEFS="${SEDDEFS}\${SEDdA}CRAY_STACKSEG_END\${SEDdB}CRAY_STACKSEG_END\${SEDdC}getb67\${SEDdD}
  1754. \${SEDuA}CRAY_STACKSEG_END\${SEDuB}CRAY_STACKSEG_END\${SEDuC}getb67\${SEDuD}
  1755. \${SEDeA}CRAY_STACKSEG_END\${SEDeB}CRAY_STACKSEG_END\${SEDeC}getb67\${SEDeD}
  1756. "
  1757. }
  1758.  
  1759.  
  1760. fi
  1761. rm -f conftest*
  1762.  
  1763. fi
  1764. rm -f conftest*
  1765.  
  1766. fi
  1767. rm -f conftest*
  1768.  
  1769.  
  1770. fi
  1771. rm -f conftest*
  1772.  
  1773.  
  1774. fi
  1775. rm -f conftest*
  1776.  
  1777. if test -n "$alloca_missing"; then
  1778.   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
  1779.   # that cause trouble.  Some versions do not even contain alloca or
  1780.   # contain a buggy version.  If you still want to use their alloca,
  1781.   # use ar to extract alloca.o from them instead of compiling alloca.c.
  1782.   ALLOCA=alloca.o
  1783.   
  1784. {
  1785. test -n "$verbose" && \
  1786. echo "    defining C_ALLOCA"
  1787. echo "#define" C_ALLOCA 1 >> confdefs.h
  1788. DEFS="$DEFS -DC_ALLOCA=1"
  1789. SEDDEFS="${SEDDEFS}\${SEDdA}C_ALLOCA\${SEDdB}C_ALLOCA\${SEDdC}1\${SEDdD}
  1790. \${SEDuA}C_ALLOCA\${SEDuB}C_ALLOCA\${SEDuC}1\${SEDuD}
  1791. \${SEDeA}C_ALLOCA\${SEDeB}C_ALLOCA\${SEDeC}1\${SEDeD}
  1792. "
  1793. }
  1794.  
  1795.  
  1796.   echo 'checking stack direction for C alloca'
  1797.   echo checking whether cross-compiling
  1798. # If we cannot run a trivial program, we must be cross compiling.
  1799. cat > conftest.c <<EOF
  1800. #include "confdefs.h"
  1801. main(){exit(0);}
  1802. EOF
  1803. eval $compile
  1804. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1805.   :
  1806. else
  1807.   rm -rf conftest*
  1808.   cross_compiling=1
  1809. fi
  1810. rm -f conftest*
  1811.  
  1812. if test -n "$cross_compiling"
  1813. then
  1814.   
  1815. {
  1816. test -n "$verbose" && \
  1817. echo "    defining" STACK_DIRECTION to be 0
  1818. echo "#define" STACK_DIRECTION 0 >> confdefs.h
  1819. DEFS="$DEFS -DSTACK_DIRECTION=0"
  1820. SEDDEFS="${SEDDEFS}\${SEDdA}STACK_DIRECTION\${SEDdB}STACK_DIRECTION\${SEDdC}0\${SEDdD}
  1821. \${SEDuA}STACK_DIRECTION\${SEDuB}STACK_DIRECTION\${SEDuC}0\${SEDuD}
  1822. \${SEDeA}STACK_DIRECTION\${SEDeB}STACK_DIRECTION\${SEDeC}0\${SEDeD}
  1823. "
  1824. }
  1825.  
  1826. else
  1827. cat > conftest.c <<EOF
  1828. #include "confdefs.h"
  1829. find_stack_direction ()
  1830. {
  1831.   static char *addr = 0;
  1832.   auto char dummy;
  1833.   if (addr == 0)
  1834.     {
  1835.       addr = &dummy;
  1836.       return find_stack_direction ();
  1837.     }
  1838.   else
  1839.     return (&dummy > addr) ? 1 : -1;
  1840. }
  1841. main ()
  1842. {
  1843.   exit (find_stack_direction() < 0);
  1844. }
  1845. EOF
  1846. eval $compile
  1847. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1848.   rm -rf conftest*
  1849.   
  1850. {
  1851. test -n "$verbose" && \
  1852. echo "    defining" STACK_DIRECTION to be 1
  1853. echo "#define" STACK_DIRECTION 1 >> confdefs.h
  1854. DEFS="$DEFS -DSTACK_DIRECTION=1"
  1855. SEDDEFS="${SEDDEFS}\${SEDdA}STACK_DIRECTION\${SEDdB}STACK_DIRECTION\${SEDdC}1\${SEDdD}
  1856. \${SEDuA}STACK_DIRECTION\${SEDuB}STACK_DIRECTION\${SEDuC}1\${SEDuD}
  1857. \${SEDeA}STACK_DIRECTION\${SEDeB}STACK_DIRECTION\${SEDeC}1\${SEDeD}
  1858. "
  1859. }
  1860.  
  1861.  
  1862. else
  1863.   rm -rf conftest*
  1864.   
  1865. {
  1866. test -n "$verbose" && \
  1867. echo "    defining" STACK_DIRECTION to be -1
  1868. echo "#define" STACK_DIRECTION -1 >> confdefs.h
  1869. DEFS="$DEFS -DSTACK_DIRECTION=-1"
  1870. SEDDEFS="${SEDDEFS}\${SEDdA}STACK_DIRECTION\${SEDdB}STACK_DIRECTION\${SEDdC}-1\${SEDdD}
  1871. \${SEDuA}STACK_DIRECTION\${SEDuB}STACK_DIRECTION\${SEDuC}-1\${SEDuD}
  1872. \${SEDeA}STACK_DIRECTION\${SEDeB}STACK_DIRECTION\${SEDeC}-1\${SEDeD}
  1873. "
  1874. }
  1875.  
  1876. fi
  1877. fi
  1878. rm -f conftest*
  1879. fi
  1880.  
  1881. echo checking for st_blocks in struct stat
  1882. cat > conftest.c <<EOF
  1883. #include "confdefs.h"
  1884. #include <sys/types.h>
  1885. #include <sys/stat.h>
  1886. int main() { exit(0); }
  1887. int t() { struct stat s; s.st_blocks; }
  1888. EOF
  1889. if eval $compile; then
  1890.   rm -rf conftest*
  1891.   
  1892. {
  1893. test -n "$verbose" && \
  1894. echo "    defining HAVE_ST_BLOCKS"
  1895. echo "#define" HAVE_ST_BLOCKS 1 >> confdefs.h
  1896. DEFS="$DEFS -DHAVE_ST_BLOCKS=1"
  1897. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_ST_BLOCKS\${SEDdB}HAVE_ST_BLOCKS\${SEDdC}1\${SEDdD}
  1898. \${SEDuA}HAVE_ST_BLOCKS\${SEDuB}HAVE_ST_BLOCKS\${SEDuC}1\${SEDuD}
  1899. \${SEDeA}HAVE_ST_BLOCKS\${SEDeB}HAVE_ST_BLOCKS\${SEDeC}1\${SEDeD}
  1900. "
  1901. }
  1902.  
  1903.  
  1904. else
  1905.   rm -rf conftest*
  1906.   LIBOBJS="$LIBOBJS fileblocks.o"
  1907. fi
  1908. rm -f conftest*
  1909.  
  1910. echo checking utime with null argument
  1911. rm -f conftestdata; > conftestdata
  1912. # Sequent interprets utime(file, 0) to mean use start of epoch.  Wrong.
  1913. cat > conftest.c <<EOF
  1914. #include "confdefs.h"
  1915. #include <sys/types.h>
  1916. #include <sys/stat.h>
  1917. main() {
  1918. struct stat s, t;
  1919. exit(!(stat ("conftestdata", &s) == 0 && utime("conftestdata", (long *)0) == 0
  1920. && stat("conftestdata", &t) == 0 && t.st_mtime >= s.st_mtime
  1921. && t.st_mtime - s.st_mtime < 120));
  1922. }
  1923. EOF
  1924. eval $compile
  1925. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1926.   rm -rf conftest*
  1927.   
  1928. {
  1929. test -n "$verbose" && \
  1930. echo "    defining HAVE_UTIME_NULL"
  1931. echo "#define" HAVE_UTIME_NULL 1 >> confdefs.h
  1932. DEFS="$DEFS -DHAVE_UTIME_NULL=1"
  1933. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_UTIME_NULL\${SEDdB}HAVE_UTIME_NULL\${SEDdC}1\${SEDdD}
  1934. \${SEDuA}HAVE_UTIME_NULL\${SEDuB}HAVE_UTIME_NULL\${SEDuC}1\${SEDuD}
  1935. \${SEDeA}HAVE_UTIME_NULL\${SEDeB}HAVE_UTIME_NULL\${SEDeC}1\${SEDeD}
  1936. "
  1937. }
  1938.  
  1939.  
  1940. fi
  1941. rm -f conftest*
  1942. rm -f core
  1943.  
  1944. echo checking for Xenix
  1945. cat > conftest.c <<EOF
  1946. #include "confdefs.h"
  1947. #if defined(M_XENIX) && !defined(M_UNIX)
  1948.   yes
  1949. #endif
  1950.  
  1951. EOF
  1952. eval "$CPP conftest.c > conftest.out 2>&1"
  1953. if egrep "yes" conftest.out >/dev/null 2>&1; then
  1954.   rm -rf conftest*
  1955.   XENIX=1
  1956.  
  1957. fi
  1958. rm -f conftest*
  1959.  
  1960. if test -n "$XENIX"; then
  1961.   LIBS="$LIBS -lx"
  1962.   case "$DEFS" in
  1963.   *SYSNDIR*) ;;
  1964.   *) LIBS="-ldir $LIBS" ;; # Make sure -ldir precedes any -lx.
  1965.   esac
  1966. fi
  1967.  
  1968. LIBS_save="${LIBS}"
  1969. LIBS="${LIBS} -lsun"
  1970. have_lib=""
  1971. echo checking for -lsun
  1972. cat > conftest.c <<EOF
  1973. #include "confdefs.h"
  1974.  
  1975. int main() { exit(0); }
  1976. int t() { main(); }
  1977. EOF
  1978. if eval $compile; then
  1979.   rm -rf conftest*
  1980.   have_lib="1"
  1981.  
  1982. fi
  1983. rm -f conftest*
  1984. LIBS="${LIBS_save}"
  1985. if test -n "${have_lib}"; then
  1986.    :; LIBS="$LIBS -lsun"
  1987. else
  1988.    :; 
  1989. fi
  1990.  
  1991.  
  1992. LIBS_save="${LIBS}"
  1993. LIBS="${LIBS} -lseq"
  1994. have_lib=""
  1995. echo checking for -lseq
  1996. cat > conftest.c <<EOF
  1997. #include "confdefs.h"
  1998.  
  1999. int main() { exit(0); }
  2000. int t() { main(); }
  2001. EOF
  2002. if eval $compile; then
  2003.   rm -rf conftest*
  2004.   have_lib="1"
  2005.  
  2006. fi
  2007. rm -f conftest*
  2008. LIBS="${LIBS_save}"
  2009. if test -n "${have_lib}"; then
  2010.    :; LIBS="$LIBS -lseq"
  2011. else
  2012.    :; 
  2013. fi
  2014.  
  2015.  
  2016. # Check for libypsec.a on Dolphin M88K machines.
  2017. LIBS_save="${LIBS}"
  2018. LIBS="${LIBS} -lypsec"
  2019. have_lib=""
  2020. echo checking for -lypsec
  2021. cat > conftest.c <<EOF
  2022. #include "confdefs.h"
  2023.  
  2024. int main() { exit(0); }
  2025. int t() { main(); }
  2026. EOF
  2027. if eval $compile; then
  2028.   rm -rf conftest*
  2029.   have_lib="1"
  2030.  
  2031. fi
  2032. rm -f conftest*
  2033. LIBS="${LIBS_save}"
  2034. if test -n "${have_lib}"; then
  2035.    
  2036. {
  2037. test -n "$verbose" && \
  2038. echo "    defining HAVE_LIBYPSEC"
  2039. echo "#define" HAVE_LIBYPSEC 1 >> confdefs.h
  2040. DEFS="$DEFS -DHAVE_LIBYPSEC=1"
  2041. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_LIBYPSEC\${SEDdB}HAVE_LIBYPSEC\${SEDdC}1\${SEDdD}
  2042. \${SEDuA}HAVE_LIBYPSEC\${SEDuB}HAVE_LIBYPSEC\${SEDuC}1\${SEDuD}
  2043. \${SEDeA}HAVE_LIBYPSEC\${SEDeB}HAVE_LIBYPSEC\${SEDeC}1\${SEDeD}
  2044. "
  2045. }
  2046.  
  2047.    LIBS="${LIBS} -lypsec"
  2048. fi
  2049.  
  2050.  
  2051. # m88k running dgux 5.4 needs this
  2052. LIBS_save="${LIBS}"
  2053. LIBS="${LIBS} -ldgc"
  2054. have_lib=""
  2055. echo checking for -ldgc
  2056. cat > conftest.c <<EOF
  2057. #include "confdefs.h"
  2058.  
  2059. int main() { exit(0); }
  2060. int t() { main(); }
  2061. EOF
  2062. if eval $compile; then
  2063.   rm -rf conftest*
  2064.   have_lib="1"
  2065.  
  2066. fi
  2067. rm -f conftest*
  2068. LIBS="${LIBS_save}"
  2069. if test -n "${have_lib}"; then
  2070.    
  2071. {
  2072. test -n "$verbose" && \
  2073. echo "    defining HAVE_LIBDGC"
  2074. echo "#define" HAVE_LIBDGC 1 >> confdefs.h
  2075. DEFS="$DEFS -DHAVE_LIBDGC=1"
  2076. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_LIBDGC\${SEDdB}HAVE_LIBDGC\${SEDdC}1\${SEDdD}
  2077. \${SEDuA}HAVE_LIBDGC\${SEDuB}HAVE_LIBDGC\${SEDuC}1\${SEDuD}
  2078. \${SEDeA}HAVE_LIBDGC\${SEDeB}HAVE_LIBDGC\${SEDeC}1\${SEDeD}
  2079. "
  2080. }
  2081.  
  2082.    LIBS="${LIBS} -ldgc"
  2083. fi
  2084.  
  2085.  
  2086. echo checking for AFS
  2087. test -d /afs && 
  2088. {
  2089. test -n "$verbose" && \
  2090. echo "    defining AFS"
  2091. echo "#define" AFS 1 >> confdefs.h
  2092. DEFS="$DEFS -DAFS=1"
  2093. SEDDEFS="${SEDDEFS}\${SEDdA}AFS\${SEDdB}AFS\${SEDdC}1\${SEDdD}
  2094. \${SEDuA}AFS\${SEDuB}AFS\${SEDuC}1\${SEDuD}
  2095. \${SEDeA}AFS\${SEDeB}AFS\${SEDeC}1\${SEDeD}
  2096. "
  2097. }
  2098.  
  2099.  
  2100. # Set default prefixes.
  2101. if test -n "$prefix"; then
  2102.   test -z "$exec_prefix" && exec_prefix='${prefix}'
  2103.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  2104. fi
  2105. if test -n "$exec_prefix"; then
  2106.   prsub="$prsub
  2107. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%exec_prefix\\1=\\2$exec_prefix%"
  2108. fi
  2109. # Quote sed substitution magic chars in DEFS.
  2110. cat >conftest.def <<EOF
  2111. $DEFS
  2112. EOF
  2113. escape_ampersand_and_backslash='s%[&\\]%\\&%g'
  2114. DEFS=`sed "$escape_ampersand_and_backslash" <conftest.def`
  2115. rm -f conftest.def
  2116. # Substitute for predefined variables.
  2117.  
  2118. trap 'rm -f config.status; exit 1' 1 3 15
  2119. echo creating config.status
  2120. rm -f config.status
  2121. cat > config.status <<EOF
  2122. #!/bin/sh
  2123. # Generated automatically by configure.
  2124. # Run this file to recreate the current configuration.
  2125. # This directory was configured as follows,
  2126. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  2127. #
  2128. # $0 $configure_args
  2129.  
  2130. for arg
  2131. do
  2132.   case "\$arg" in
  2133.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  2134.     echo running \${CONFIG_SHELL-/bin/sh} $0 $configure_args
  2135.     exec \${CONFIG_SHELL-/bin/sh} $0 $configure_args ;;
  2136.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  2137.   esac
  2138. done
  2139.  
  2140. trap 'rm -fr Makefile lib/Makefile src/Makefile man/Makefile config.h conftest*; exit 1' 1 3 15
  2141. PROGS='$PROGS'
  2142. LIBPROGS='$LIBPROGS'
  2143. CC='$CC'
  2144. CFLAGS='$CFLAGS'
  2145. LDFLAGS='$LDFLAGS'
  2146. CPP='$CPP'
  2147. RANLIB='$RANLIB'
  2148. YACC='$YACC'
  2149. LIBOBJS='$LIBOBJS'
  2150. ALLOCA='$ALLOCA'
  2151. LIBS='$LIBS'
  2152. srcdir='$srcdir'
  2153. prefix='$prefix'
  2154. exec_prefix='$exec_prefix'
  2155. prsub='$prsub'
  2156. extrasub='$extrasub'
  2157. EOF
  2158. cat >> config.status <<\EOF
  2159.  
  2160. top_srcdir=$srcdir
  2161.  
  2162. CONFIG_FILES=${CONFIG_FILES-"Makefile lib/Makefile src/Makefile man/Makefile"}
  2163. for file in .. ${CONFIG_FILES}; do if test "x$file" != x..; then
  2164.   srcdir=$top_srcdir
  2165.   # Remove last slash and all that follows it.  Not all systems have dirname.
  2166.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  2167.   if test "$dir" != "$file"; then
  2168.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  2169.     test ! -d $dir && mkdir $dir
  2170.   fi
  2171.   echo creating $file
  2172.   rm -f $file
  2173.   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  2174.   sed -e "
  2175. $prsub
  2176. $extrasub
  2177. s%@PROGS@%$PROGS%g
  2178. s%@LIBPROGS@%$LIBPROGS%g
  2179. s%@CC@%$CC%g
  2180. s%@CFLAGS@%$CFLAGS%g
  2181. s%@LDFLAGS@%$LDFLAGS%g
  2182. s%@CPP@%$CPP%g
  2183. s%@RANLIB@%$RANLIB%g
  2184. s%@YACC@%$YACC%g
  2185. s%@LIBOBJS@%$LIBOBJS%g
  2186. s%@ALLOCA@%$ALLOCA%g
  2187. s%@LIBS@%$LIBS%g
  2188. s%@srcdir@%$srcdir%g
  2189. s%@DEFS@%-DHAVE_CONFIG_H%" $top_srcdir/${file}.in >> $file
  2190. fi; done
  2191.  
  2192. CONFIG_HEADERS=${CONFIG_HEADERS-"config.h"}
  2193. for file in .. ${CONFIG_HEADERS}; do if test "x$file" != x..; then
  2194. echo creating $file
  2195.  
  2196. # These sed commands are put into SEDDEFS when defining a macro.
  2197. # They are broken into pieces to make the sed script easier to manage.
  2198. # They are passed to sed as "A NAME B NAME C VALUE D", where NAME
  2199. # is the cpp macro being defined and VALUE is the value it is being given.
  2200. # Each defining turns into a single global substitution command.
  2201. #
  2202. # SEDd sets the value in "#define NAME VALUE" lines.
  2203. SEDdA='s@^\([     ]*\)#\([     ]*define[     ][     ]*\)'
  2204. SEDdB='\([     ][     ]*\)[^     ]*@\1#\2'
  2205. SEDdC='\3'
  2206. SEDdD='@g'
  2207. # SEDu turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
  2208. SEDuA='s@^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  2209. SEDuB='\([     ]\)@\1#\2define\3'
  2210. SEDuC=' '
  2211. SEDuD='\4@g'
  2212. # SEDe turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
  2213. SEDeA='s@^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  2214. SEDeB='$@\1#\2define\3'
  2215. SEDeC=' '
  2216. SEDeD='@g'
  2217. rm -f conftest.sed
  2218. EOF
  2219. # Turn off quoting long enough to insert the sed commands.
  2220. rm -f conftest.sh
  2221. cat > conftest.sh <<EOF
  2222. $SEDDEFS
  2223. EOF
  2224.  
  2225. # Break up $SEDDEFS (now in conftest.sh) because some shells have a limit
  2226. # on the size of here documents.
  2227.  
  2228. # Maximum number of lines to put in a single here document.
  2229. maxshlines=9
  2230.  
  2231. while :
  2232. do
  2233.   # wc gives bogus results for an empty file on some systems.
  2234.   lines=`grep -c . conftest.sh`
  2235.   if test -z "$lines" || test "$lines" -eq 0; then break; fi
  2236.   rm -f conftest.s1 conftest.s2
  2237.   sed ${maxshlines}q conftest.sh > conftest.s1 # Like head -20.
  2238.   sed 1,${maxshlines}d conftest.sh > conftest.s2 # Like tail +21.
  2239.   # Write a limited-size here document to append to conftest.sed.
  2240.   echo 'cat >> conftest.sed <<CONFEOF' >> config.status
  2241.   cat conftest.s1 >> config.status
  2242.   echo 'CONFEOF' >> config.status
  2243.   rm -f conftest.s1 conftest.sh
  2244.   mv conftest.s2 conftest.sh
  2245. done
  2246. rm -f conftest.sh
  2247.  
  2248. # Now back to your regularly scheduled config.status.
  2249. cat >> config.status <<\EOF
  2250. # This sed command replaces #undef's with comments.  This is necessary, for
  2251. # example, in the case of _POSIX_SOURCE, which is predefined and required
  2252. # on some systems where configure will not decide to define it in
  2253. # config.h.
  2254. cat >> conftest.sed <<\CONFEOF
  2255. s,^[     ]*#[     ]*undef[     ][     ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
  2256. CONFEOF
  2257. rm -f conftest.h
  2258. # Break up the sed commands because old seds have small limits.
  2259. maxsedlines=20
  2260. cp $top_srcdir/$file.in conftest.h1
  2261. while :
  2262. do
  2263.   lines=`grep -c . conftest.sed`
  2264.   if test -z "$lines" || test "$lines" -eq 0; then break; fi
  2265.   rm -f conftest.s1 conftest.s2 conftest.h2
  2266.   sed ${maxsedlines}q conftest.sed > conftest.s1 # Like head -20.
  2267.   sed 1,${maxsedlines}d conftest.sed > conftest.s2 # Like tail +21.
  2268.   sed -f conftest.s1 < conftest.h1 > conftest.h2
  2269.   rm -f conftest.s1 conftest.h1 conftest.sed
  2270.   mv conftest.h2 conftest.h1
  2271.   mv conftest.s2 conftest.sed
  2272. done
  2273. rm -f conftest.sed conftest.h
  2274. echo "/* $file.  Generated automatically by configure.  */" > conftest.h
  2275. cat conftest.h1 >> conftest.h
  2276. rm -f conftest.h1
  2277. if cmp -s $file conftest.h 2>/dev/null; then
  2278.   # The file exists and we would not be changing it.
  2279.   echo "$file is unchanged"
  2280.   rm -f conftest.h
  2281. else
  2282.   rm -f $file
  2283.   mv conftest.h $file
  2284. fi
  2285. fi; done
  2286.  
  2287.  
  2288.  
  2289. exit 0
  2290. EOF
  2291. chmod +x config.status
  2292. ${CONFIG_SHELL-/bin/sh} config.status
  2293.  
  2294.